<template>
	<view>
		<!-- 按钮 -->
		<view hover-class="bg-main-hover" class="bg-main text-white font rounded-circle text-center m-3" 
		style="height: 80rpx; line-height: 80rpx;" @click="logout">退出登录</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			logout(){
				this.$store.dispatch('logout').then(res =>{
					uni.showToast({
						title:'退出成功',
						icon:'none'
					})
					setTimeout(()=>{
						uni.switchTab({
							url:'../my/my'
						})
					},500)
				}).catch(err=>{
					console.log(err)
					uni.showToast({
						title:'退出失败:'+err,
						icon:'none'
					})
				})
			}
		}
	}
</script>

<style>

</style>
